package tech.aistar.mapper.adopt;

import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import tech.aistar.entity.adopt.AdoptCat;

import java.util.List;

/**
 * Created by 陆锦鹏 on 2019/9/23.
 */
public interface AdoptCatMapper {

    @Select("select * from adopt_cat")
    List<AdoptCat> findAll();

    @Select("select * from adopt_cat where cat_id=#{value}")
    AdoptCat findOneById(Integer id);

    @Update("update adopt_cat set status = 1 where cat_id = #{value}")
    void delById(Integer id);

    @Insert("insert into adopt_cat(cat_id,growth_id,cat_price,introduction) " +
            "values(#{catId},#{growthId},#{catPrice},#{introduction})")
    void save(AdoptCat adoptCat);

    @Update("update adopt_cat set cat_id=#{catId},growth_id=#{growthId},cat_price=#{catPrice},introduction=#{introduction} where id=#{id}")
    void update(AdoptCat adoptCat);

}
